package servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import news.*;

public class DoModifyTopicServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		long tid = Long.parseLong(request.getParameter("tid"));
		Topic t = TopicDao.dao.showOneTopic(tid).get(0);
		request.setAttribute("tid", tid);
		request.setAttribute("topic", t);
		request.getRequestDispatcher("WEB-INF/jsp/doModifyTopic.jsp").forward(
				request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.doGet(request, response);
	}

}
